package com.codeoss.framework.webide.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.codeoss.framework.webide.request.ModelWizardDialogRequest;
import com.codeoss.framework.webide.response.ModelWizardDialogResponse;
import com.codeoss.framework.webide.service.IModelWizardDialogService;

@Controller
@RequestMapping("webide/modelwizarddialog")
public class ModelWizardDialogController {
	@Autowired
	private IModelWizardDialogService modelWizardDialogService;

	@RequestMapping(value = "onFinish", method = RequestMethod.POST)
	@ResponseBody
	public ModelWizardDialogResponse onFinish(@RequestBody ModelWizardDialogRequest request) {
		ModelWizardDialogResponse modelWizardDialogResponse = modelWizardDialogService.onFinish(request);
		return modelWizardDialogResponse;
	}
	
	@RequestMapping(value = "initModuleTypeSelectPage", method = RequestMethod.GET)
	@ResponseBody
	public ModelWizardDialogResponse initModuleTypeSelectPage() {
		ModelWizardDialogResponse modelWizardDialogResponse = modelWizardDialogService.initModuleTypeSelectPage();
		return modelWizardDialogResponse;
	}
}
